package src.demo;

import com.baidubce.qianfan.Qianfan;
import com.baidubce.qianfan.core.StreamIterator;
import com.baidubce.qianfan.model.completion.CompletionResponse;

/**
 * @author 23050
 * @version 1.0
 * @description: TODO
 * @date 2025/2/28 22:17
 */
public class BaiduCompletion {

    public static void main(String[] args) {
        // 使用安全认证AK/SK鉴权，替换下列示例中参数，安全认证Access Key替换your_iam_ak，Secret Key替换your_iam_sk，如何获取请查看https://cloud.baidu.com/doc/Reference/s/9jwvz2egb
        Qianfan qianfan = new Qianfan("ALTAKtHrVjlvjaVTZM0UhYzlPU", "68526f5de5724772bab11775862c4a12");

        // 指定模型
        CompletionResponse resp = qianfan.completion()
                .model("CodeLlama-7b-Instruct")
                .prompt("public static void")
                .execute();
        System.out.print(resp.getResult());



    }


}
